<template>
   <div class="covid">
     <img :src="`${staticPath}/nav_icon_back@2x(28).png`" style="width: 100%" alt="">

     <div class="entry">
       <h3>核酸检测预约</h3>
       <van-button color="#F77B80" block to="/user/covid/check">登记信息</van-button>
       <!-- <template v-if="isIphone">
       <van-button color="#4ECE40" block @click="show = true">查询报告</van-button>

         <img :src="`${staticPath}/qrnum.jpeg`" style="width: 200px;height:auto" alt="" srcset="">
       </template> -->
       <template>
        <wx-open-launch-weapp :username="originalID"  :path="appPath" style="width: 100%;height:44px">
          <script type="text/wxtag-template">
            <button
              style="width: 100%; height: 44px; display:block; font-size: 14px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 2px; background-color: #07c160; color:#fff;"
            >
              查询报告
            </button>
          </script>
        </wx-open-launch-weapp>
       </template>
     </div>
   </div>
</template>

<script>
import { initWxJSDK } from "@/utils/wx-util";
import browser from '@/utils/browser';
export default {
   data () {
      return {
        staticPath: process.env.VUE_APP_STATIC_PATH,
        originalID: 'gh_dc5faf6be488',
        appPath: 'pages/index/index',
        openTag: '',
        staticPath: process.env.VUE_APP_STATIC_PATH,
      };
   },

   components: {},

   computed: {
     isIphone(){
       return browser.iPhone || browser.iPad
     }
   },
   created() {
     // this.fetchInitWxutil()
   },
   methods: {
     
     async fetchInitWxutil() {
       await initWxJSDK([
         "scanQRCode",
         "chooseImage",
         "uploadImage",
         "previewImage",
         "chooseWXPay",
       ]);
     },
   }
}
</script>
<style lang='less'>
.covid{
  .entry{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 60px;
    h3{
      font-size: 20px;
      color: #000;
      margin-bottom: 50px;
    }
    .van-button{
      margin-bottom: 15px;
    }
  }
}
</style>